import { todoService } from '@server/services/todo-service'
import { ApiResponse } from '@data/api'

export default async function cleanupTrashTodos() {
  const count = await todoService.cleanupDeletedTodos()

  const response: ApiResponse = {
    success: true,
    data: { deletedCount: count },
    message: `Cleaned up ${count} expired todos`,
  }

  return response
}
